//
//  StatusNormalCell.swift
//  weibo
//
//  Created by yellow on 15/10/22.
//  Copyright © 2015年 yellow. All rights reserved.
//

import UIKit

class StatusNormalCell: StatusViewCell {
    
    override var viewModel:StatusDetailViewModel?{
        didSet{
            statusPictureView.snp_updateConstraints { (make) -> Void in
                make.width.equalTo(statusPictureView.bounds.width)
                make.height.equalTo(statusPictureView.bounds.height)

                //当没有配图是，就取消statusPictureView距离正文的间距
                let top = statusPictureView.bounds.height>0 ? widgetMargin : 0
                make.top.equalTo(body.snp_bottom).offset(top)
            }
        }
    }
    
    override func setUI() {
        super.setUI()
        
        statusPictureView.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(body.snp_bottom).offset(widgetMargin)
            make.left.equalTo(self.contentView.snp_left).offset(widgetMargin)
        }

    }
}
